Optimal. Leaf size=185 \[ \frac {(5 A-i B) x}{16 a^3 c^2}+\frac {A+i B}{24 a^3 c^2 f (i-\tan (e+f x))^3}-\frac {3 i A-B}{32 a^3 c^2 f (i-\tan (e+f x))^2}-\frac {3 A}{16 a^3 c^2 f (i-\tan (e+f x))}+\frac {i A+B}{32 a^3 c^2 f (i+\tan (e+f x))^2}+\frac {2 A-i B}{16 a^3 c^2 f (i+\tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 185, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 78, 209}
\begin {gather*} \frac {2 A-i B}{16 a^3 c^2 f (\tan (e+f x)+i)}-\frac {-B+3 i A}{32 a^3 c^2 f (-\tan (e+f x)+i)^2}+\frac {B+i A}{32 a^3 c^2 f (\tan (e+f x)+i)^2}+\frac {A+i B}{24 a^3 c^2 f (-\tan (e+f x)+i)^3}+\frac {x (5 A-i B)}{16 a^3 c^2}-\frac {3 A}{16 a^3 c^2 f (-\tan (e+f x)+i)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 209
Rule 3669
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^2} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^4 (c-i c x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {A+i B}{8 a^4 c^3 (-i+x)^4}+\frac {i (3 A+i B)}{16 a^4 c^3 (-i+x)^3}-\frac {3 A}{16 a^4 c^3 (-i+x)^2}-\frac {i (A-i B)}{16 a^4 c^3 (i+x)^3}+\frac {-2 A+i B}{16 a^4 c^3 (i+x)^2}+\frac {5 A-i B}{16 a^4 c^3 \left (1+x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {A+i B}{24 a^3 c^2 f (i-\tan (e+f x))^3}-\frac {3 i A-B}{32 a^3 c^2 f (i-\tan (e+f x))^2}-\frac {3 A}{16 a^3 c^2 f (i-\tan (e+f x))}+\frac {i A+B}{32 a^3 c^2 f (i+\tan (e+f x))^2}+\frac {2 A-i B}{16 a^3 c^2 f (i+\tan (e+f x))}+\frac {(5 A-i B) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{16 a^3 c^2 f}\\ &=\frac {(5 A-i B) x}{16 a^3 c^2}+\frac {A+i B}{24 a^3 c^2 f (i-\tan (e+f x))^3}-\frac {3 i A-B}{32 a^3 c^2 f (i-\tan (e+f x))^2}-\frac {3 A}{16 a^3 c^2 f (i-\tan (e+f x))}+\frac {i A+B}{32 a^3 c^2 f (i+\tan (e+f x))^2}+\frac {2 A-i B}{16 a^3 c^2 f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.13, size = 217, normalized size = 1.17 \begin {gather*} \frac {\sec ^3(e+f x) (\cos (2 (e+f x))+i \sin (2 (e+f x))) (12 (A (-5+10 i f x)+B (-i+2 f x)) \cos (e+f x)+3 (5 A-9 i B) \cos (3 (e+f x))+A \cos (5 (e+f x))-5 i B \cos (5 (e+f x))+60 i A \sin (e+f x)-12 B \sin (e+f x)-120 A f x \sin (e+f x)+24 i B f x \sin (e+f x)+45 i A \sin (3 (e+f x))+9 B \sin (3 (e+f x))+5 i A \sin (5 (e+f x))+B \sin (5 (e+f x)))}{384 a^3 c^2 f (-i+\tan (e+f x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.30, size = 148, normalized size = 0.80
method | result | size |
derivativedivides | \(\frac {\left (-\frac {5 i A}{32}-\frac {B}{32}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )+\frac {3 A}{16 \left (-i+\tan \left (f x +e \right )\right )}-\frac {\frac {3 i A}{16}-\frac {B}{16}}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {\frac {A}{8}+\frac {i B}{8}}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {\frac {i B}{16}-\frac {A}{8}}{i+\tan \left (f x +e \right )}+\left (\frac {5 i A}{32}+\frac {B}{32}\right ) \ln \left (i+\tan \left (f x +e \right )\right )-\frac {-\frac {i A}{16}-\frac {B}{16}}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}}{f \,a^{3} c^{2}}\) | \(148\) |
default | \(\frac {\left (-\frac {5 i A}{32}-\frac {B}{32}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )+\frac {3 A}{16 \left (-i+\tan \left (f x +e \right )\right )}-\frac {\frac {3 i A}{16}-\frac {B}{16}}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {\frac {A}{8}+\frac {i B}{8}}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {\frac {i B}{16}-\frac {A}{8}}{i+\tan \left (f x +e \right )}+\left (\frac {5 i A}{32}+\frac {B}{32}\right ) \ln \left (i+\tan \left (f x +e \right )\right )-\frac {-\frac {i A}{16}-\frac {B}{16}}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}}{f \,a^{3} c^{2}}\) | \(148\) |
norman | \(\frac {\frac {\left (-i B +5 A \right ) x}{16 a c}-\frac {-i A +B}{6 a c f}+\frac {\left (-i B +5 A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{6 a c f}+\frac {\left (-i B +5 A \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{16 a c f}+\frac {3 \left (-i B +5 A \right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{16 a c}+\frac {3 \left (-i B +5 A \right ) x \left (\tan ^{4}\left (f x +e \right )\right )}{16 a c}+\frac {\left (-i B +5 A \right ) x \left (\tan ^{6}\left (f x +e \right )\right )}{16 a c}+\frac {\left (i B +11 A \right ) \tan \left (f x +e \right )}{16 a c f}}{\left (1+\tan ^{2}\left (f x +e \right )\right )^{3} a^{2} c}\) | \(209\) |
risch | \(-\frac {i x B}{16 a^{3} c^{2}}+\frac {5 x A}{16 a^{3} c^{2}}-\frac {{\mathrm e}^{-6 i \left (f x +e \right )} B}{192 a^{3} c^{2} f}+\frac {i {\mathrm e}^{-6 i \left (f x +e \right )} A}{192 a^{3} c^{2} f}-\frac {\cos \left (4 f x +4 e \right ) B}{32 a^{3} c^{2} f}+\frac {i \cos \left (4 f x +4 e \right ) A}{32 a^{3} c^{2} f}+\frac {i \sin \left (4 f x +4 e \right ) B}{64 a^{3} c^{2} f}+\frac {3 \sin \left (4 f x +4 e \right ) A}{64 a^{3} c^{2} f}-\frac {5 \cos \left (2 f x +2 e \right ) B}{64 a^{3} c^{2} f}+\frac {5 i \cos \left (2 f x +2 e \right ) A}{64 a^{3} c^{2} f}-\frac {i \sin \left (2 f x +2 e \right ) B}{64 a^{3} c^{2} f}+\frac {15 \sin \left (2 f x +2 e \right ) A}{64 a^{3} c^{2} f}\) | \(238\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.01, size = 121, normalized size = 0.65 \begin {gather*} \frac {{\left (24 \, {\left (5 \, A - i \, B\right )} f x e^{\left (6 i \, f x + 6 i \, e\right )} - 3 \, {\left (i \, A + B\right )} e^{\left (10 i \, f x + 10 i \, e\right )} - 6 \, {\left (5 i \, A + 3 \, B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} - 12 \, {\left (-5 i \, A + B\right )} e^{\left (4 i \, f x + 4 i \, e\right )} - 3 \, {\left (-5 i \, A + 3 \, B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 2 i \, A - 2 \, B\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{384 \, a^{3} c^{2} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.46, size = 452, normalized size = 2.44 \begin {gather*} \begin {cases} \frac {\left (\left (33554432 i A a^{12} c^{8} f^{4} e^{6 i e} - 33554432 B a^{12} c^{8} f^{4} e^{6 i e}\right ) e^{- 6 i f x} + \left (251658240 i A a^{12} c^{8} f^{4} e^{8 i e} - 150994944 B a^{12} c^{8} f^{4} e^{8 i e}\right ) e^{- 4 i f x} + \left (1006632960 i A a^{12} c^{8} f^{4} e^{10 i e} - 201326592 B a^{12} c^{8} f^{4} e^{10 i e}\right ) e^{- 2 i f x} + \left (- 503316480 i A a^{12} c^{8} f^{4} e^{14 i e} - 301989888 B a^{12} c^{8} f^{4} e^{14 i e}\right ) e^{2 i f x} + \left (- 50331648 i A a^{12} c^{8} f^{4} e^{16 i e} - 50331648 B a^{12} c^{8} f^{4} e^{16 i e}\right ) e^{4 i f x}\right ) e^{- 12 i e}}{6442450944 a^{15} c^{10} f^{5}} & \text {for}\: a^{15} c^{10} f^{5} e^{12 i e} \neq 0 \\x \left (- \frac {5 A - i B}{16 a^{3} c^{2}} + \frac {\left (A e^{10 i e} + 5 A e^{8 i e} + 10 A e^{6 i e} + 10 A e^{4 i e} + 5 A e^{2 i e} + A - i B e^{10 i e} - 3 i B e^{8 i e} - 2 i B e^{6 i e} + 2 i B e^{4 i e} + 3 i B e^{2 i e} + i B\right ) e^{- 6 i e}}{32 a^{3} c^{2}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (5 A - i B\right )}{16 a^{3} c^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.94, size = 219, normalized size = 1.18 \begin {gather*} -\frac {\frac {6 \, {\left (-5 i \, A - B\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a^{3} c^{2}} + \frac {6 \, {\left (5 i \, A + B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{3} c^{2}} + \frac {3 \, {\left (-15 i \, A \tan \left (f x + e\right )^{2} - 3 \, B \tan \left (f x + e\right )^{2} + 38 \, A \tan \left (f x + e\right ) - 10 i \, B \tan \left (f x + e\right ) + 25 i \, A + 9 \, B\right )}}{a^{3} c^{2} {\left (-i \, \tan \left (f x + e\right ) + 1\right )}^{2}} + \frac {-55 i \, A \tan \left (f x + e\right )^{3} - 11 \, B \tan \left (f x + e\right )^{3} - 201 \, A \tan \left (f x + e\right )^{2} + 33 i \, B \tan \left (f x + e\right )^{2} + 255 i \, A \tan \left (f x + e\right ) + 27 \, B \tan \left (f x + e\right ) + 117 \, A + 3 i \, B}{a^{3} c^{2} {\left (\tan \left (f x + e\right ) - i\right )}^{3}}}{192 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.47, size = 208, normalized size = 1.12 \begin {gather*} \frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {25\,A}{48\,a^3\,c^2}-\frac {B\,5{}\mathrm {i}}{48\,a^3\,c^2}\right )+{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {5\,A}{16\,a^3\,c^2}-\frac {B\,1{}\mathrm {i}}{16\,a^3\,c^2}\right )+{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {B}{16\,a^3\,c^2}+\frac {A\,5{}\mathrm {i}}{16\,a^3\,c^2}\right )+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {5\,B}{48\,a^3\,c^2}+\frac {A\,25{}\mathrm {i}}{48\,a^3\,c^2}\right )-\frac {B}{6\,a^3\,c^2}+\frac {A\,1{}\mathrm {i}}{6\,a^3\,c^2}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^5\,1{}\mathrm {i}+{\mathrm {tan}\left (e+f\,x\right )}^4+{\mathrm {tan}\left (e+f\,x\right )}^3\,2{}\mathrm {i}+2\,{\mathrm {tan}\left (e+f\,x\right )}^2+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}+1\right )}-\frac {x\,\left (B+A\,5{}\mathrm {i}\right )\,1{}\mathrm {i}}{16\,a^3\,c^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________